package com.share.demo.service;

import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
*
* @date 2017/12/17
* @author caifan 
*
*/
public class HelloConsumer {
    public static void main(String[] args) throws Exception {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[]{"spring-dubbo-consumer.xml"});
        context.start();
        System.out.println("consumer start success!");
        HelloService helloService = (HelloService) context.getBean("helloService");
        String hello = helloService.sayHello("zhangsan");
        System.out.println(hello);
        /*while (true) {
            byte[] b = new byte[1024];
            int read = System.in.read(b);
            if (new String(b, 0, read).trim().equals("send")) {
                System.out.println(helloService.sayHello("hello consumer!!"));
            }
        }*/
    }
}
